<?php


namespace app\common\repositories\activity;


use app\common\dao\activity\NewActivityCouponRelevanceDao;
use app\common\repositories\BaseRepository;
use FormBuilder\Exception\FormBuilderException;
use FormBuilder\Factory\Elm;
use FormBuilder\Form;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\facade\Route;

class NewActivityProductCouponRelevanceRepository extends BaseRepository
{
    /**
     * NewActivityProductCouponRelevanceRepository constructor.
     * @param NewActivityCouponRelevanceDao $dao
     */
    public function __construct(NewActivityCouponRelevanceDao $dao)
    {
        $this->dao = $dao;
    }


    /**
     * @param array $where
     * @param int $page
     * @param int $limit
     * @return array
     * @author: fupeng
     * @day: 2024/1/28
     */
    public function getAdminList(array $where, int $page, int $limit)
    {
        $query = $this->dao->search($where);
        $count = $query->count();
        $list = $query->page($page, $limit)->select();
        return compact('count','list');
    }
}
